package com.woniu.hisoutpatientservicefacade.api;

import com.woniu.hisoutpatientservicefacade.dto.LoginDto;
import com.woniu.hisoutpatientservicefacade.dto.QueryMedicalRecordParam;
import com.woniu.hisoutpatientservicefacade.dto.ViewInspectionResultsDto;
import com.woniu.hisoutpatientservicefacade.param.*;
import com.woniu.util.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;


@FeignClient(value = "outpatient-service", contextId = "outpatient-service", path = "outpatient-service")
@Api(tags = "门诊聚合服务")
public interface OutpatientServiceAPI {

    @ApiOperation("挂号前登录")
    @PostMapping("login")
    Result<LoginDto> login(@RequestBody LoginParam loginParam);

    @ApiOperation("预约")
    @PostMapping("/register")
    Result register(@RequestBody RegisterParam registerParam);

    @ApiOperation("查询科室")
    @GetMapping("/queryOffice")
    Result queryOffice();

    @ApiOperation("查询当前科室值班医生")
    @PostMapping("/querySchedulingInfo")
    Result querySchedulingInfo(@RequestBody QueryDoctorParam param);

    @ApiOperation("查询医生详情")
    @GetMapping("queryDoctor/{doctorId}")
    Result queryDoctor(@PathVariable("doctorId") Integer doctorId);

    @ApiOperation("支付费用")
    @PostMapping("/payment")
    Result payment(@RequestBody Integer registerId);

    @ApiOperation("支付回调")
    @PostMapping("/paymentCallback")
    Result paymentCallback(@RequestParam("patientCardid") String patientCardid);

    @ApiOperation("叫号查询患者队列")
    @GetMapping("/queryPatientCohort")
    Result queryPatientCohort();

    @ApiOperation("叫号")
    @GetMapping("/callNumber")
    Result callNumber();

    @ApiOperation("过号")
    @GetMapping("/skipPatient")
    Result skipPatient();

    @ApiOperation("显示屏查询")
    @GetMapping("/queryOfficePatientCohort/{officeId}")
    Result queryOfficePatientCohort(@PathVariable("officeId") Integer officeId);

    @ApiOperation("病历查询")
    @PostMapping("/queryMedicalRecord")
    Result queryMedicalRecord(@RequestBody QueryMedicalRecordParam param);

    @ApiOperation("生成病历")
    @PostMapping("/generateMedicalRecord")
    Result generateMedicalRecord(@RequestBody GenerateMedicalRecordParam param);

    @ApiOperation("查看病历")
    @GetMapping("/viewMedicalRecord/{caseId}")
    Result viewMedicalRecord(@PathVariable("caseId") Integer caseId);

    @ApiOperation("查看检查项目")
    @GetMapping("/viewInspectionItems")
    Result viewInspectionItems();

    @ApiOperation("生成检查单")
    @PostMapping("/generateChecklist")
    Result generateChecklist(@RequestBody GenerateChecklistParam param);

    @ApiOperation("查看检查结果")
    @PostMapping("/viewInspectionResults")
    Result<ViewInspectionResultsDto> viewInspectionResults(@RequestBody ViewInspectionResultsParam param);

    @ApiOperation("根据名称查询药品")
    @GetMapping("/queryMedicineName")
    Result queryMedicineName(@RequestParam("medicineName") String medicineName);

//    @ApiOperation("添加药品到药品单")
//    @PostMapping("/createMedicine")
//    Result createMedicine(@RequestBody GenerateDrugOrderParam param);

    @ApiOperation("生成或修改药品单")
    @PostMapping("/generateDrugOrder")
    Result generateDrugOrder(@RequestBody GenerateDrugOrderParam param);

    @ApiOperation("查询药品单")
    @GetMapping("/queryDrugOrder/{careId}")
    Result queryDrugOrder(@PathVariable("careId") Integer careId);

//    @ApiOperation("药品单收费")
//    @GetMapping("/tollDrugOrder/{careId}")
//    Result tollDrugOrder(@PathVariable("careId") Integer careId);

    @ApiOperation("药品单收费回调")
    @GetMapping("/tollDrugOrderCallback")
    Result tollDrugOrderCallback();

    @ApiOperation("取药")
    @PostMapping("/takeMedicine/{careId}")
    Result takeMedicine(@PathVariable("careId") Integer careId);

    @ApiOperation("住院申请单")
    @PostMapping("/applyForHospitalization")
    Result applyForHospitalization(@RequestBody PatientDetailsParam param);

}
